# NOT RUN {
## Example harp
type = "harp"
# generate random numbers
n = 500
Y = rmixnorm(n, type = type)
# compute the density
x = seq(min(Y), max(Y), length.out = n)
f = dmixnorm(x, type = type)
# compute the distribution
F = pmixnorm(x, type = type)
# plots
op = par(mfrow = c(1,2))
plot(x, f, type = "l", main = "Harp Density")
rug(Y, col = 'red')
plot(x, F, type = "l", main = "Harp Distribution")
rug(Y, col = 'red')
par(op)
# }
Run the code above in your browser using DataLab